import requset from '../../utils/requset'

// 工单状态列表
export const allTaskStatus = () => requset({
  url: '/task-service/task/allTaskStatus'
})

// 工单搜索
export const search = (params) => requset({
  url: '/task-service/task/search',
  params
})

// 获取所有工单类型
export const taplist = (params) => requset({
  url: '/task-service/taskType/list',
  params
})
// 获取工单详情
export const taskInfo = (id) => requset({
  url: `/task-service/task/taskInfo/${id}`
})

// 取消工单
export const cancel = (id) => requset({
  url: `/task-service/task/cancel/${id}`,
  method: 'post'
})

// 根据售货机获取维修人员列表
//  /api/user-service/user/repairerList/:innerCode
export const repairerList = (id) => requset({
  url: `/user-service/user/repairerList/${id}`
})

// 创建工单
// Path： /api/task-service/task/create
export const create = (data) => requset({
  url: '/task-service/task/create',
  method: 'post',
  data
})
// 获取售货机货道详情
//  /api/vm-service/channel/channelList/:innerCode
export const channelList = (id) => requset({
  url: `/vm-service/channel/channelList/${id}`
})

// 获取补货预警值
// /api/task-service/task/supplyAlertValue
export const supplyAlertValue = () => requset({
  url: '/task-service/task/supplyAlertValue'
})

// 设置自动补货工单阈值
//  /api/task-service/task/autoSupplyConfig
export const autoSupplyConfig = (data) => requset({
  url: '/task-service/task/autoSupplyConfig',
  method: 'post',
  data
})
